/*
 * @Author: kanglang
 * @Date: 2020-09-18 11:03:02
 * @LastEditors: kanglang
 * @LastEditTime: 2021-02-18 16:53:51
 * @Description: 收藏按钮
 */
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, Image } from 'react-native';
import { px2dp } from '../../../../../common/styles/index';

export default function FavoriteBtn(
    { btnStyle, wordStyle, hendleTitle = "取消", handleBtn, showFav } = this.props
) {
    const submitBtn = (item) => {
        handleBtn(item);
    };
    return (
        <TouchableOpacity style={[styles.common, btnStyle]} onPress={submitBtn}>
            <Image style={styles.icon} source={showFav ? require('../../../../../image/wl/collected.png') : require('../../../../../image/wl/collection.png')} />
            <Text style={wordStyle}>{hendleTitle}</Text>
        </TouchableOpacity>
    );
}
const styles = StyleSheet.create({
    common: {
        backgroundColor: '#FFFFFF',
        borderRadius: px2dp(4) * 2,
        borderColor: '#CDCCC9',
        borderWidth: px2dp(1),
        paddingTop: px2dp(4) * 2,
        paddingBottom: px2dp(4) * 2,
        paddingLeft: px2dp(22) * 2,
        paddingRight: px2dp(22) * 2,
        marginLeft: px2dp(8) * 2,
        flexDirection: 'row',
        alignItems: 'center'

    },
    icon: {
        marginRight: px2dp(5) * 2,
        height: px2dp(14) * 2,
        width: px2dp(14) * 2,
    }
});